package com.jsd2412.backend.nurse.controller;

import com.jsd2412.backend.base.response.JsonResult;
import com.jsd2412.backend.nurse.pojo.dto.ServiceProParam;
import com.jsd2412.backend.nurse.pojo.dto.ServiceProQuery;
import com.jsd2412.backend.nurse.pojo.vo.ServiceProVO;
import com.jsd2412.backend.nurse.service.NurseService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.spring.web.json.Json;

import java.util.List;
@Api(tags = "护理管理")
@RestController
@RequestMapping(value = "/v1/nurse/")
@Slf4j
public class NurseController {
   @Autowired
   private NurseService nurseService;

    /**
     * 服务项目列表
     * @param serviceProQuery
     * @return
     */
   @GetMapping(value = "service-pro-list")
   public JsonResult NurseList(ServiceProQuery serviceProQuery){
       log.debug("查询服务项目，{}", serviceProQuery);
       List<ServiceProVO> serviceProVOS = nurseService.selectAllService(serviceProQuery);
       return JsonResult.ok(serviceProVOS);
   }

    /**
     * 新增服务项目
     * @param serviceProParam
     * @return
     */
   @PostMapping(value = "service-pro-add")
   public JsonResult addServicePro(ServiceProParam serviceProParam){
        log.debug("新增服务项目，{}",serviceProParam);
        nurseService.addServicePro(serviceProParam);
        return JsonResult.ok();

   }

    /**
     * 查询所有项目类别
     * @return
     */
   @GetMapping(value = "select-pro-type")
   public JsonResult selectProType(){
        return JsonResult.ok(nurseService.selectAllProType());
   }

    /**
     * 查询所有项目费用类别
     * @return
     */
    @GetMapping(value = "select-pro-free-type")
    public JsonResult selectProFreeType(){
        return JsonResult.ok(nurseService.selectAllProFreeType());
    }




}
